package cn.com.ry.framework.mongodb.sync.util;

import cn.com.ry.framework.mongodb.sync.service.SynService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.concurrent.BlockingQueue;

@Component
public class Consumer implements Runnable {
    @Autowired
    private SynService synService;

    protected BlockingQueue queue = null;

    public void setConsumer(BlockingQueue queue) {
        this.queue = queue;
    }

    public void run() {
        while (true) {
            synService.excuteTask(queue);
        }
    }
}
